import styled from 'styled-components'
import logoPic from '../../statics/logo.png'

export const HeaderWrapper = styled.div`
  z-index: 1;
  position: relative; 
  height: 58px;
  width: 1440px;
  margin: 0 auto;
`
export const Logo = styled.div`
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100px;
  height: 56px;
  background: url(${logoPic});  
  background-size: contain;
`

export const Nav = styled.div`
  width: 960px;
  height: 100%;
  padding-right: 70px;
  margin: 0 auto;
`

export const NavItem = styled.div`
  line-height: 56px;
  padding: 0 15px;
  font-size: 17px;
  color: #333;
  cursor: pointer;
  &:hover{
    opacity: .6;
  }
  &.left {
    float: left;
  }
  &.right {
    float: right;
    color: #969696;
  }
  &.active {
    color: #ea6f5a;
  }
`

export const SearchWrapper = styled.div`
  position: relative;
  float: left;
  .search {
    position: absolute;
    right: 5px;
    width: 30px;
    height: 30px;
    border-radius: 15px;
    text-align: center;
    line-height: 30px;
    bottom: 5px;
  }
`

export const NavSearch = styled.input.attrs({
  placeholder: '搜索'
})`
  width: 160px;
  height: 38px;
  padding: 0 30px 0 20px;
  margin-top: 9px;
  margin-left: 20px;
  border: none;
  outline: none;
  border-radius: 19px;
  background: #eee;
  font-size: 14px;
  color: #666;
  transition: all 0.4s;

  &::placeholder {
    color: #999;
  }

  &.focus {
    width: 200px;
    + .iconfont {
      background-color: #969696;
      color: #fff;
    }
  }
`

export const SearchInfo = styled.div`
  position: absolute;
  left: 22px;
  top: 59px;
  width: 250px;
  padding: 20px 20px 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  background-color: #fff;
  &::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-bottom-color: #fff;
    left: 20px;
    bottom: 99%;
  }
`

export const SearchInfoTitle = styled.div`
  margin-bottom: 15px;
  line-height: 20px;
  font-size: 14px;
  color: #969696;
`

export const SearchInfoSwitch = styled.span`
  float: right;
  font-size: 13px;
  cursor: pointer;
  &:hover {
    color: #2f2f2f;
  }
  .spin {
    /* 如果盒子不是 block 则无法发生动画 */
    display: block;
    float: left;
    transition: all .5s ease;
    font-size: 12px;
    margin-right: 2px;
    transform: rotate(360deg);
    transform-origin: center center;
  }
`
export const SearchInfoItem = styled.a`
  cursor: pointer;
  display: inline-block;
  margin-right: 10px;
  margin-bottom: 15px;
  padding: 2px 6px;
  font-size: 12px;
  color: #787878;
  border: 1px solid #ddd;
  border-radius: 3px;
  &:hover {
    color: #333;
    border-color: #b4b4b4;
  }
`

export const Addition = styled.div`
  position: absolute;
  right: 0;
  top: 0;
  height: 56px;
`

export const Button = styled.div`
  float: left;
  margin-top: 9px;
  margin-right: 20px;
  padding: 0 20px;
  line-height: 38px;
  border-radius: 19px;
  border: 1px solid #ec6149;
  font-size: 14px;
  &.reg {
    color: #ec6149;
  }
  &.writting {
    color: #fff;
    background: #ec6149;
  }
  img {
    vertical-align: middle;
  }
`
